/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package br.ufrn.chassi;

import static org.junit.Assert.assertEquals;
import org.junit.Test;

/**
 *
 * @author jorge
 */

public class ValidarChassiTest {
    
    ValidarChassi util = new ValidarChassi();
    
    @Test
    public void validarAnoANoChassi() {
        assertEquals(2010, util.validar("9BP17164GA000001", 10));
    }
    
    @Test
    public void validarAno9NoChassi() {
        assertEquals(2009, util.validar("9BP17164G9000002", 10));
    }
    
    @Test
    public void validarAnoBNoChassi() {
        assertEquals(2011, util.validar("9BP17164GB000003", 10));
    }
    
    @Test
    public void validarAnoAMinusculoNoChassi() {
         assertEquals(2010, util.validar("9bp17164ga000001", 10));
    }
    
    @Test(expected=IllegalArgumentException.class)
    public void validarAnoIncorreto() {
        assertEquals(2020, util.validar("9bp17164gz000004", 10));
    }
}